package com.example.springboot.modules.security.controller;

import com.example.springboot.globalutils.R;
import com.example.springboot.modules.security.service.LoginServcie;
import com.example.springboot.modules.security.controller.req.LoginUserReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/user")
public class LoginController {

    @Autowired
    private LoginServcie loginServcie;

    @PostMapping("/login")
    public R<HashMap<String,String>> login(@RequestBody LoginUserReq user){
        return R.success(loginServcie.login(user));
    }
}
